/*
 * Selling Partner API for Product Type Definitions
 *
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).
 *
 * The version of the OpenAPI document: 2020-09-01
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using RestSharp;
using software.amzn.spapi.Client;
using software.amzn.spapi.Auth;

using software.amzn.spapi.Model.productTypeDefinitions.v2020_09_01;

namespace software.amzn.spapi.Api.productTypeDefinitions.v2020_09_01
{
    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public interface IDefinitionsApi : IApiAccessor
    {
        #region Synchronous Operations
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>ProductTypeDefinition</returns>
        ProductTypeDefinition GetDefinitionsProductType (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>ApiResponse of ProductTypeDefinition</returns>
        ApiResponse<ProductTypeDefinition> GetDefinitionsProductTypeWithHttpInfo (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>ProductTypeList</returns>
        ProductTypeList SearchDefinitionsProductTypes (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>ApiResponse of ProductTypeList</returns>
        ApiResponse<ProductTypeList> SearchDefinitionsProductTypesWithHttpInfo (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null);
        #endregion Synchronous Operations
        #region Asynchronous Operations
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>Task of ProductTypeDefinition</returns>
        System.Threading.Tasks.Task<ProductTypeDefinition> GetDefinitionsProductTypeAsync (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>Task of ApiResponse (ProductTypeDefinition)</returns>
        System.Threading.Tasks.Task<ApiResponse<ProductTypeDefinition>> GetDefinitionsProductTypeAsyncWithHttpInfo (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>Task of ProductTypeList</returns>
        System.Threading.Tasks.Task<ProductTypeList> SearchDefinitionsProductTypesAsync (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>Task of ApiResponse (ProductTypeList)</returns>
        System.Threading.Tasks.Task<ApiResponse<ProductTypeList>> SearchDefinitionsProductTypesAsyncWithHttpInfo (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null);
        #endregion Asynchronous Operations
    }

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public partial class DefinitionsApi : IDefinitionsApi
    {
        private software.amzn.spapi.Client.ExceptionFactory _exceptionFactory = (name, response) => null;

        /// <summary>
        /// Initializes a new instance of the <see cref="DefinitionsApi"/> class
        /// using Configuration object
        /// </summary>
        /// <param name="configuration">An instance of Configuration</param>
        /// <returns></returns>
        public DefinitionsApi(software.amzn.spapi.Client.Configuration configuration)
        {
            this.Configuration = configuration;
            ExceptionFactory = software.amzn.spapi.Client.Configuration.DefaultExceptionFactory;
        }

        IReadableConfiguration IApiAccessor.Configuration 
        {
            get => Configuration;  // Implicit upcast to interface
            set => Configuration = (software.amzn.spapi.Client.Configuration)value;
        }

        /// <summary>
        /// Gets the base path of the API client.
        /// </summary>
        /// <value>The base path</value>
        public String GetBasePath()
        {
            return this.Configuration.ApiClient.RestClient.Options.BaseUrl.ToString();
        }

        /// <summary>
        /// Sets the base path of the API client.
        /// </summary>
        /// <value>The base path</value>
        [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
        public void SetBasePath(String basePath)
        {
            // do nothing
        }

        /// <summary>
        /// Gets or sets the configuration object
        /// </summary>
        /// <value>An instance of the Configuration</value>
        public software.amzn.spapi.Client.Configuration Configuration {get; set;}

        /// <summary>
        /// Provides a factory method hook for the creation of exceptions.
        /// </summary>
        public software.amzn.spapi.Client.ExceptionFactory ExceptionFactory
        {
            get
            {
                if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
                {
                    throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
                }
                return _exceptionFactory;
            }
            set { _exceptionFactory = value; }
        }

        /// <summary>
        /// Gets the default header.
        /// </summary>
        /// <returns>Dictionary of HTTP header</returns>
        [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
        public IDictionary<String, String> DefaultHeader()
        {
            return new ReadOnlyDictionary<string, string>(this.Configuration.DefaultHeader);
        }

        /// <summary>
        /// Add default header.
        /// </summary>
        /// <param name="key">Header field name.</param>
        /// <param name="value">Header field value.</param>
        /// <returns></returns>
        [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
        public void AddDefaultHeader(string key, string value)
        {
            this.Configuration.AddDefaultHeader(key, value);
        }

        /// <summary>
        ///  Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>ProductTypeDefinition</returns>
        public ProductTypeDefinition GetDefinitionsProductType (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null)
        {
             ApiResponse<ProductTypeDefinition> localVarResponse = GetDefinitionsProductTypeWithHttpInfo(productType, marketplaceIds, sellerId, productTypeVersion, requirements, requirementsEnforced, locale);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>ApiResponse of ProductTypeDefinition</returns>
        public ApiResponse< ProductTypeDefinition > GetDefinitionsProductTypeWithHttpInfo (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null)
        {
            // verify the required parameter 'productType' is set
            if (productType == null)
                throw new ApiException(400, "Missing required parameter 'productType' when calling DefinitionsApi->GetDefinitionsProductType");
            // verify the required parameter 'marketplaceIds' is set
            if (marketplaceIds == null)
                throw new ApiException(400, "Missing required parameter 'marketplaceIds' when calling DefinitionsApi->GetDefinitionsProductType");

            var localVarPath = "/definitions/2020-09-01/productTypes/{productType}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (productType != null) localVarPathParams.Add("productType", this.Configuration.ApiClient.ParameterToString(productType)); // path parameter
            if (sellerId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sellerId", sellerId)); // query parameter
            if (marketplaceIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "marketplaceIds", marketplaceIds)); // query parameter
            if (productTypeVersion != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "productTypeVersion", productTypeVersion)); // query parameter
            if (requirements != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "requirements", requirements)); // query parameter
            if (requirementsEnforced != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "requirementsEnforced", requirementsEnforced)); // query parameter
            if (locale != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "locale", locale)); // query parameter


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetDefinitionsProductType", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<ProductTypeDefinition>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (ProductTypeDefinition) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ProductTypeDefinition)));
        }

        /// <summary>
        ///  Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>Task of ProductTypeDefinition</returns>
        public async System.Threading.Tasks.Task<ProductTypeDefinition> GetDefinitionsProductTypeAsync (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null)
        {
             ApiResponse<ProductTypeDefinition> localVarResponse = await GetDefinitionsProductTypeAsyncWithHttpInfo(productType, marketplaceIds, sellerId, productTypeVersion, requirements, requirementsEnforced, locale);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  Retrieve an Amazon product type definition.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="productType">The Amazon product type name.</param>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.</param>
        /// <param name="sellerId">A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)</param>
        /// <param name="productTypeVersion">The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;,. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided. (optional, default to &quot;LATEST&quot;)</param>
        /// <param name="requirements">The name of the requirements set to retrieve requirements for. (optional, default to LISTING)</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to ENFORCED)</param>
        /// <param name="locale">Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to DEFAULT)</param>
        /// <returns>Task of ApiResponse (ProductTypeDefinition)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<ProductTypeDefinition>> GetDefinitionsProductTypeAsyncWithHttpInfo (string productType, List<string> marketplaceIds, string? sellerId = null, string? productTypeVersion = null, string? requirements = null, string? requirementsEnforced = null, string? locale = null)
        {
            // verify the required parameter 'productType' is set
            if (productType == null)
                throw new ApiException(400, "Missing required parameter 'productType' when calling DefinitionsApi->GetDefinitionsProductType");
            // verify the required parameter 'marketplaceIds' is set
            if (marketplaceIds == null)
                throw new ApiException(400, "Missing required parameter 'marketplaceIds' when calling DefinitionsApi->GetDefinitionsProductType");

            var localVarPath = "/definitions/2020-09-01/productTypes/{productType}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (productType != null) localVarPathParams.Add("productType", this.Configuration.ApiClient.ParameterToString(productType)); // path parameter
            if (sellerId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "sellerId", sellerId)); // query parameter
            if (marketplaceIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "marketplaceIds", marketplaceIds)); // query parameter
            if (productTypeVersion != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "productTypeVersion", productTypeVersion)); // query parameter
            if (requirements != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "requirements", requirements)); // query parameter
            if (requirementsEnforced != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "requirementsEnforced", requirementsEnforced)); // query parameter
            if (locale != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "locale", locale)); // query parameter


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetDefinitionsProductType", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<ProductTypeDefinition>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (ProductTypeDefinition) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ProductTypeDefinition)));
        }

        /// <summary>
        ///  Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>ProductTypeList</returns>
        public ProductTypeList SearchDefinitionsProductTypes (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null)
        {
             ApiResponse<ProductTypeList> localVarResponse = SearchDefinitionsProductTypesWithHttpInfo(marketplaceIds, keywords, itemName, locale, searchLocale);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>ApiResponse of ProductTypeList</returns>
        public ApiResponse< ProductTypeList > SearchDefinitionsProductTypesWithHttpInfo (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null)
        {
            // verify the required parameter 'marketplaceIds' is set
            if (marketplaceIds == null)
                throw new ApiException(400, "Missing required parameter 'marketplaceIds' when calling DefinitionsApi->SearchDefinitionsProductTypes");

            var localVarPath = "/definitions/2020-09-01/productTypes";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (keywords != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "keywords", keywords)); // query parameter
            if (marketplaceIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "marketplaceIds", marketplaceIds)); // query parameter
            if (itemName != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "itemName", itemName)); // query parameter
            if (locale != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "locale", locale)); // query parameter
            if (searchLocale != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "searchLocale", searchLocale)); // query parameter


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("SearchDefinitionsProductTypes", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<ProductTypeList>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (ProductTypeList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ProductTypeList)));
        }

        /// <summary>
        ///  Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>Task of ProductTypeList</returns>
        public async System.Threading.Tasks.Task<ProductTypeList> SearchDefinitionsProductTypesAsync (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null)
        {
             ApiResponse<ProductTypeList> localVarResponse = await SearchDefinitionsProductTypesAsyncWithHttpInfo(marketplaceIds, keywords, itemName, locale, searchLocale);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  Search for and return a list of Amazon product types that have definitions available.  **Usage Plans:**  | Plan type | Rate (requests per second) | Burst | | - -- - | - -- - | - -- - | |Default| 5 | 10 | |Selling partner specific| Variable | Variable |  The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="marketplaceIds">A comma-delimited list of Amazon marketplace identifiers for the request.</param>
        /// <param name="keywords">A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;. (optional)</param>
        /// <param name="itemName">The title of the ASIN to get the product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;. (optional)</param>
        /// <param name="locale">The locale for the display names in the response. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <param name="searchLocale">The locale used for the &#x60;keywords&#x60; and &#x60;itemName&#x60; parameters. Defaults to the primary locale of the marketplace. (optional)</param>
        /// <returns>Task of ApiResponse (ProductTypeList)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<ProductTypeList>> SearchDefinitionsProductTypesAsyncWithHttpInfo (List<string> marketplaceIds, List<string>? keywords = null, string? itemName = null, string? locale = null, string? searchLocale = null)
        {
            // verify the required parameter 'marketplaceIds' is set
            if (marketplaceIds == null)
                throw new ApiException(400, "Missing required parameter 'marketplaceIds' when calling DefinitionsApi->SearchDefinitionsProductTypes");

            var localVarPath = "/definitions/2020-09-01/productTypes";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (keywords != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "keywords", keywords)); // query parameter
            if (marketplaceIds != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "marketplaceIds", marketplaceIds)); // query parameter
            if (itemName != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "itemName", itemName)); // query parameter
            if (locale != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "locale", locale)); // query parameter
            if (searchLocale != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "searchLocale", searchLocale)); // query parameter


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("SearchDefinitionsProductTypes", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<ProductTypeList>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (ProductTypeList) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ProductTypeList)));
        }


        public class Builder
        {
            private LWAAuthorizationCredentials lwaAuthorizationCredentials;
            private RateLimitConfiguration rateLimitConfiguration;

            public Builder SetLWAAuthorizationCredentials(LWAAuthorizationCredentials lwaAuthorizationCredentials)
            {
                this.lwaAuthorizationCredentials = lwaAuthorizationCredentials;
                return this;
            }
            
            
            public Builder SetRateLimitConfiguration(RateLimitConfiguration rateLimitConfiguration)
            {
                this.rateLimitConfiguration = rateLimitConfiguration;
                return this;
            }

            public DefinitionsApi Build() 
            {
                if (lwaAuthorizationCredentials == null) 
                {
                    throw new NullReferenceException("LWAAuthoriztionCredentials not set");
                }

                
                software.amzn.spapi.Client.Configuration configuration = new software.amzn.spapi.Client.Configuration()
                {
                    AuthorizationCredentials = lwaAuthorizationCredentials,
                    RateLimitConfig = rateLimitConfiguration
                };

                // default HTTP connection timeout (in milliseconds)
                configuration.initializeApiClient();
                configuration.Timeout = 100000;

                return new DefinitionsApi(configuration);
            }
        }
        
        private static Multimap<string, string> ConvertHeadersToMultimap(RestResponse response)
        {
            var multimap = new Multimap<string, string>();
            foreach (var header in response.Headers)
            {
                multimap.Add(header.Name, header.Value?.ToString());
            }
            return multimap;
        }


        private static RestSharp.Method ChangeHttpMethod(String httpMethod) {
            switch(httpMethod) {
                case "GET":
                    // GET logic
                    return Method.Get;
                case "POST":
                    // POST logic
                    return Method.Post;
                case "DELETE":
                    return Method.Delete;
                case "PUT":
                    return Method.Put;
                case "PATCH":
                    return Method.Patch;
                case "OPTIONS":
                    return Method.Options;
            }
            return Method.Head;
        }

    }
}
